<?php
class ui_input_option extends ui
{
	function __construct($text=null,$value=null,$selected=false)
	{
		global $ti;
		#$ti->log('created option: '.$text.'/'.$value.'/'.$selected);
		
		$this->init(__FILE__,'option');
		$this->set('value',$value);
		$this->text($text);
		if($selected)
		{
			$this->set('selected','selected');
		}
	}
	
	function set_selected($state=true)
	{
		if($state)
		{
			$this->attributes['selected']='selected';
		}
		else
		{
			unset($this->attributes['selected']);
		}
	}
}
?>